package com.m1book.domain.trace;

import java.io.Serializable;
import java.util.Date;

import org.bson.types.ObjectId;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;

import com.m1book.domain.book.ABook;
import com.m1book.domain.common.Trace;
import com.m1book.domain.user.Miser;

@Document(collection = "m1_trace")
public class M1ABookTrace extends Trace implements Serializable {
	private static final long serialVersionUID = 1275172668938308638L;
	
	public final static int ANWSER_AGREE = 1;
	public final static int ANWSER_REFUSE = 0;
	
	@DBRef
	private Miser miser;
	
	@DBRef
	private Miser holder;
	
	@DBRef
	private ABook abook;
	
	private Date applyTime;
	
	private Date confirmTime;
	
	@Indexed
	private int anwser;
	
	@Indexed
	private String sequnceCode;
	
	public M1ABookTrace() {
		id = ObjectId.get();
	}

	public Miser getMiser() {
		return miser;
	}

	public void setMiser(Miser miser) {
		this.miser = miser;
	}

	public Miser getHolder() {
		return holder;
	}

	public void setHolder(Miser holder) {
		this.holder = holder;
	}

	public ABook getAbook() {
		return abook;
	}

	public void setAbook(ABook abook) {
		this.abook = abook;
	}

	public Date getApplyTime() {
		return applyTime;
	}

	public void setApplyTime(Date applyTime) {
		this.applyTime = applyTime;
	}

	public Date getConfirmTime() {
		return confirmTime;
	}

	public void setConfirmTime(Date confirmTime) {
		this.confirmTime = confirmTime;
	}

	public int getAnwser() {
		return anwser;
	}

	public void setAnwser(int anwser) {
		this.anwser = anwser;
	}

	public String getSequnceCode() {
		return sequnceCode;
	}

	public void setSequnceCode(String sequnceCode) {
		this.sequnceCode = sequnceCode;
	}
}
